package com.example.shop.order.dao;

import com.example.shop.order.dto.OrderGoodsInfo;
import org.apache.ibatis.annotations.*;

@Mapper
public interface OrderGoodsInfoDao {

    @Results(id = "OrderGoodsInfoResultMap",value = {
        @Result(column = "merchant_id",property = "merchantBriefInfo",
                one = @One(select = "com.example.shop.merchant.dao.MerchantBriefInfoDao.selectById")),
        @Result(column = "goods_id",property = "goodsDescriptionPicture",
                one = @One(select = "com.example.shop.mapper.GoodsDescriptionPictureMapper.selectOnePictureById")),
        @Result(column = "goods_name",property = "goodsName")
    })
    @Select("select merchant_id,goods_id,goods_name from goods where goods_id = ${goodsId}")
    OrderGoodsInfo selectById(long goodsId);
}
